﻿using System.Web.Mvc;
using DevFramework.Business.Abstract;
using DevFramework.Business.Abstract;

namespace DevFramework.MvcUI.Controllers
{
    public class CategoryController : Controller
    {
        private readonly ICategoryService _categoryService;

        public CategoryController(ICategoryService categoryService)
        {
            _categoryService = categoryService;
        }

        public JsonResult All()
        {
            return Json(_categoryService.GetAll(), JsonRequestBehavior.AllowGet);
        }

        public PartialViewResult List()
        {
            return PartialView(_categoryService.GetAll());
        }
	}
}